﻿using ETA.DomainEnum;
using ETA.Dtos;
using ETA.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ETA.IService
{
    public interface IUserService
    {
        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="userRegisterDto"></param>
        /// <returns></returns>
        CreateUserResponse AddUser(CreateUserRequest request,bool needCheck=true);

        /// <summary>
        /// 用户信息更新
        /// </summary>
        /// <param name="userRegisterDto"></param>
        /// <returns></returns>
        ModifyUserResponse ModifyUser(ModifyUserRequest request);

        /// <summary>
        /// 角色查询
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        QueryRolerResponse QueryRoler(QueryRolerRequest request);

        /// <summary>
        ///  用户信息查询
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        QueryUserResponse QueryUser(QueryUserRequest request);

        /// <summary>
        ///  用户数量查询
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        int QueryUserCount(QueryUserRequest request);

        /// <summary>
        /// 检测邮箱是否已经被使用
        /// </summary>
        /// <param name="email"></param>
        /// <returns></returns>
        bool CheckEmail(string email);


        /// <summary>
        /// 检测手机号码是否已经被使用
        /// </summary>
        /// <param name="mobile"></param>
        /// <returns></returns>
        bool CheckMobile(string mobile);


        /// <summary>
        /// 验证码发送 发送成功返回字符，失败返回空串
        /// </summary>
        /// <param name="mobile"></param>
        /// <returns>发送成功返回字符，失败返回空串</returns>
        string SendCheckNum(string mobile, string identifyCode=null);

        /// <summary>
        /// 找回密码
        /// </summary>
        /// <param name="strNum"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        Response GetPassword(string strNum, GetpwdType type);

        string GenerateNo(string firestChar, int noType);

        List<UserView> GetFilterUser(out int rowCount, ETA.ExtendEntity.UserFilter filter);

        bool UpdateUserIsReferrer(string userId, int isReferrer);
    }
}
